#ifndef __MEASUREMENT_H__
#define __MEASUREMENT_H__

#define BENCHMARK_UNIT 1

template <class Unit> class Measurement
{
public:
    Measurement(unsigned int amount, Unit unit);
    bool operator==(const Measurement<Unit>& measurement) const;
    bool operator!=(const Measurement<Unit>& measurement) const;
    Measurement<Unit> operator+(const Measurement<Unit>& measurement) const;
protected:
    unsigned int amount_m;
    Unit unit_m;
};

template <class Unit>
Measurement<Unit>::Measurement(unsigned int amount, Unit unit): amount_m(amount), unit_m(unit)
{}

template <class Unit>
bool Measurement<Unit>::operator==(const Measurement<Unit>& measurement) const
{
    return (amount_m * unit_m == measurement.amount_m * measurement.unit_m);
}

template <class Unit>
bool Measurement<Unit>::operator!=(const Measurement<Unit>& measurement) const
{
    return !(*this == measurement);
}

template <class Unit>
Measurement<Unit> Measurement<Unit>::operator+(const Measurement<Unit>& measurement) const
{
    return Measurement<Unit>(amount_m * unit_m + measurement.amount_m * measurement.unit_m, static_cast<Unit>(BENCHMARK_UNIT));
}

#endif
